package com.khyr.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.khyr.Service.ChargeService;
import com.khyr.entity.*;
import com.khyr.feign.UserFeign;
import com.khyr.vo.OrderChargeRequestVo;
import com.khyr.vo.PrescriptionChargeVo;
import com.khyr.vo.QueryParamsVo;
import com.khyr.vo.R;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * @author 10515
 */
@RestController
@RequestMapping("/charge/Registration")
public class ChargeController {
    @Autowired
    private ChargeService chargeService;
    @Autowired
    private UserFeign userFeign;
    @GetMapping("/getNoChargeCareHistoryByRegId/{regId}")
    public R<PrescriptionChargeVo> getNoChargeCareHistoryByRegId(@PathVariable String regId){
        return chargeService.getNoChargeCareHistoryByRegId(regId);
    }
    @GetMapping("/dictionary/{dictType}")
    public R<List<DictData>> dictionary(@PathVariable String dictType){
        return chargeService.dictionary(dictType);
    }
    @PostMapping("/createOrderChargeWithCash")
    public R<String> createOrderChargeWithCash(@RequestBody OrderChargeRequestVo orderChargeRequestVo ){
        return chargeService.createOrderChargeWithCash(orderChargeRequestVo);
    }
    @PostMapping("/queryAllOrderChargeForPage")
    public R<Page<HisOrderCharge>> queryAllOrderChargeForPage(@RequestBody QueryParamsVo queryParamsVo ){
        return chargeService.queryAllOrderChargeForPage(queryParamsVo);
    }
    @GetMapping("/queryOrderChargeItemByOrderId/{orderId}")
    public R<List<HisOrderChargeItem>> queryOrderChargeItemByOrderId(@PathVariable String orderId){
        return chargeService.queryOrderChargeItemByOrderId(orderId);
    }
    @GetMapping("/getCareOrderByRegId/{regId}")
    public R<List<CareOrder>> getCareOrderByRegId(@PathVariable String regId){
        return chargeService.getCareOrderByRegId(regId);
    }
    @GetMapping("/payWithCash/{orderId}")
    public R<String> payWithCash(@PathVariable String orderId){
        return chargeService.payWithCash(orderId);
    }
}